function [ImgPairs, PSNRs, SSIMs] = deployImgPairs(ImgPairs, scale, solver_mode, hDeploy, hOutput)

if ~iscell(ImgPairs), ImgPairs = {ImgPairs}; end
if nargin < 5, hOutput = @(x, y) y; end

ImgNum = size(ImgPairs, 1);
bPair  = size(ImgPairs, 2) == 2;
PSNRs = zeros(ImgNum, 1);  SSIMs = PSNRs;
mycaffe.init(solver_mode)
for i = 1 : ImgNum
    x = ImgPairs{i, 1};
    yhat = hOutput(x, srmodel.deploy(x, hDeploy));
    ImgPairs{i, 1} = yhat;
    if ~bPair, continue; end
    
    y0 = ImgPairs{i, 2};
    s = size(yhat);  s0 = size(y0);
    if any(s < s0)
        y0 = srimg.shave(y0, ceil((s0-s)/2));
    end
    PSNRs(i) = srimg.psnr(y0, yhat, scale);
    SSIMs(i) = srimg.ssim(y0, yhat, scale);
end

if bPair
    fprintf('\tMean PSNR/SSIM is: %.3f/%.3f\n', mean(PSNRs), mean(SSIMs));
end

if ImgNum == 1 && ~bPair, ImgPairs = ImgPairs{1}; end
